package com.example.examinationtest;

import android.os.Bundle;
import android.os.Process;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Result extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_result);
		TextView Textv = (TextView)findViewById(R.id.txtCorrectAnswer);
		TextView Textv1 = (TextView)findViewById(R.id.txtResult);
		TextView Textv2 = (TextView)findViewById(R.id.txtWongAnswer);
		
		Intent iin= getIntent();
		    Bundle b = iin.getExtras();
		    if(b!=null)
		    {
		        String j =(String) b.get("CorrectAnswer");
		        String k=(String) b.getString("CorrectsNumber");
		        String w=(String) b.getString("WrongsNumber");
		        String wn =(String) b.get("WrongAnswer");
		        
		        String p=(String)b.getString("Total");
		        Textv1.setText(k+"/"+ p +" questions");
		        Textv.setText(k +"/"+p+" questions"+ "\n Include : " + j);
		        Textv2.setText(w+"/"+p +" questions.\nInclude :"+wn);
		        
		    }
		    }

	public void Check(View view)
	{
		Intent intent= new Intent(Result.this,CheckActivity.class);
		startActivity(intent);
			
	}
		
			
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.result, menu);
		return true;
	}

}
